<%@ page contentType="text/html;charset=UTF-8"%> 
<%@ include file="/taglibs.jsp" %>

<stripes:layout-render name="/layout/standard.jsp" title="登录">
    <stripes:layout-component name="contents">

        <table style="vertical-align: top;">
            <tr>
                <td style="width: 25%; vertical-align: top;">
                    <!-- Somewhat contrived example of using the errors tag 'action' attribute. -->
                    <stripes:errors action="/Login.action"/>

                    <stripes:form action="/Login.action" focus="">
                        <table>
                            <tr>
                                <td style="font-weight: bold;"><stripes:label for="username"/>:</td>
                            </tr>
                            <tr>
                                <td><stripes:text name="username" value="${user.username}"/></td>
                            </tr>
                            <tr>
                                <td style="font-weight: bold;"><stripes:label for="password"/>:</td>
                            </tr>
                            <tr>
                                <td><stripes:password name="password"/></td>
                            </tr>
                            <tr>
                                <td style="text-align: center;">
                                    <%-- If the security servlet attached a targetUrl, carry that along. --%>
                                    <stripes:hidden name="targetUrl" value="${request.parameterMap['targetUrl']}"/>
                                    <stripes:submit name="login" value="登录"/>
                                </td>
                            </tr>
                        </table>
                    </stripes:form>
                </td>
                <td/>
                <td style="vertical-align: top;">
                    <c:choose>
                        <c:when test="${empty user}">
                            <div class="sectionTitle">欢迎登录户外广告</div>

                            <p>如果还没注册,请
                            <stripes:link href="/register.jsp">注册</stripes:link>
                                                                           后再登录。</p>
                        </c:when>

                        <c:otherwise>
                            <p>你已经以用户"${user.username}".  再次登录会使当前用户退出。</p>
                        </c:otherwise>
                    </c:choose>
                </td>
            </tr>
        </table>

    </stripes:layout-component>
</stripes:layout-render>
